#include<bits/stdc++.h>
using namespace std;

int N, cnt = 0;
int r[100005];
queue<int> q;

int main(){
	freopen("duel.in", "r", stdin);
	freopen("duel.out", "w", stdout);
	
	scanf("%d", &N);
	for (int i = 1; i <= N; i ++){
		scanf("%d", &r[i]);
	}
	sort(r + 1, r + N + 1);
	for (int i = 1; i <= N; i ++){
		q.push(r[i]);
	}
	for (int i = 1; i <= N; i ++){
		while (q.size() && q.front() <= r[i]){
			q.pop();
		}
		if (q.size() && q.front() > r[i]) q.pop();
		else cnt ++;
	}
	printf("%d\n", cnt);

	return 0;
}
